package com.crane.oss.enums;

/**
 * 年级-3
 *
 * @author tyh
 *
 */
public enum GradeEnum {
	/**
	 *
	 */
	Grade_First(1, "一年级", 1),

	Grade_Second(2, "二年级", 2),

	Grade_Third(3, "三年级", 3),

	Grade_Fourth(4, "四年级", 4),

	Grade_Five(5, "五年级", 5),

	Grade_Six(6, "六年级", 6),

	Grade_Seven(7, "七年级", 1),

	Grade_Eight(8, "八年级", 2),

	Grade_Nine(9, "九年级",3 ),

	Grade_high_First(10, "高一", 1),

	Grade_high_Second(11, "高二", 2),

	Grade_high_Third(12, "高三", 3);

	private Integer type;

	private String remark;
	
	private Integer alias;

	private GradeEnum(Integer type, String remark, Integer alias) {
		this.type = type;
		this.remark = remark;
		this.alias = alias;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public Integer getAlias() {
		return alias;
	}

	public void setAlias(Integer alias) {
		this.alias = alias;
	}

	public static String getGradeEnum(Integer type) {
		for (GradeEnum gradeEnum : GradeEnum.values()) {
			if (gradeEnum.getType().equals(type)) {
				return gradeEnum.getRemark();
			}
		}
		return "";
	}

	public static String getFullGradeName(Integer type) {
		if(type >=1 && type <7){
			return SectionEnum.PRIMARY_SCHOOL.getRemark()+GradeEnum.getGradeEnum(type);
		}else if(type >=7 && type <10){
			return SectionEnum.JUNIOR_HIGH_SCHOOL.getRemark()+GradeEnum.getGradeEnum(type);
		}else if(type >=10){
			return SectionEnum.HIGH_SCHOOL.getRemark()+GradeEnum.getGradeEnum(type);
		}
		return "";
	}
	
    public static Integer getAlias(Integer type){
        for(GradeEnum gradeEnum : GradeEnum.values()){
            if(gradeEnum.getType().equals(type)){
                return gradeEnum.getAlias();
            }
        }
        return null;
    }
	
	public static void main(String[] args) {
		System.out.println(GradeEnum.getAlias(12));
	}

}
